<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
    <script>
      const name = 'tom'
      const age = 20
      //原
      var person = {name:name, age: age}
      //ES6
      var person2 = {name, age}

      console.log(person)
      console.log(person2)

      var man = {
        name: 'jack',
        age: 22,
        eat:function(food){
          console.log(this.name + ' like ' + food)
        },
        eat2: food => console.log(man.name + ' like ' + food)
        ,
        eat3(food){
          console.log(this.name + ' like ' + food)
        }
      }
      
      man.eat("apple")
      man.eat2("apple2")
      man.eat3("apple3")
    </script>
	</body>
</html>
